#include<stdio.h>

int main(int argc, char const *argv[])
{
    int i,x,y,last=1;
    printf("Input X and Y(X**Y):");
    scanf("%d**%d",&x,&y);
    for(i=1;i<=y;i++);
    last=last*x%1000;
    printf("The last 3 digths of %d**%d is:%d\n",x,y,last%1000);
    return 0;
}
